<extend name="layout/application"/>

<block name="content">

    <div class="admin-content">
        <div class="am-cf am-padding">
            <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">新增友情链接</strong> /
                <small>Create Site</small>
            </div>
        </div>
        <div class="am-g">
            <div class="am-u-sm-12 am-u-md-12">
                <form class="am-form" action="{:Url('Sites/save')}" method="post">
                    <div class="am-tabs am-margin" data-am-tabs>
                        <div class="am-tabs-bd">
                            <div class="am-tab-panel am-fade am-in am-active">
                                <div class="am-g am-margin-top">
                                    <div class="am-u-sm-4 am-u-md-2 am-text-right">
                                        所属栏目
                                    </div>
                                    <div class="am-u-sm-8 am-u-md-5 am-u-end col-end">
                                        <select data-am-selected="{btnWidth: '100%',  btnStyle: 'secondary', btnSize: 'sm', maxHeight: 360, searchBox: 1}"
                                                name="site_node_id">
                                            <option value="0">顶级分类</option>
                                            <foreach $categories as $category>
                                                <option value="{{$category.id}}">&nbsp;&nbsp;&nbsp;&nbsp;{{$category.name}}</option>
                                            </foreach>
                                        </select>
                                    </div>
                                </div>
                                <div class="am-g am-margin-top">
                                    <div class="am-u-sm-4 am-u-md-2 am-text-right">
                                        标题
                                    </div>
                                    <div class="am-u-sm-8 am-u-md-5">
                                        <input type="text" class="am-input-sm" name="name">
                                    </div>
                                    <div class="am-hide-sm-only am-u-md-5">*必填，不可重复</div>
                                </div>
                                <div class="am-g am-margin-top">
                                    <div class="am-u-sm-4 am-u-md-2 am-text-right">
                                        略缩图
                                    </div>

                                    <div class="am-u-sm-8 am-u-md-8 am-u-end col-end">
                                        <div class="am-form-group am-form-file">
                                            <button type="button" class="am-btn am-btn-success am-btn-sm new_thumb">
                                                <i class="am-icon-cloud-upload" id="loading"></i> 上传商品图片
                                            </button>
                                            <input type="file" id="image_upload">
                                            <input type="hidden" name="photo_id" value="">
                                        </div>

                                        <hr data-am-widget="divider" class="am-divider am-divider-dashed"/>

                                        <div>
                                            <img src="" id="img_show" style="max-height: 80px;">
                                        </div>
                                    </div>
                                </div>

                                <div class="am-g am-margin-top">
                                    <div class="am-u-sm-4 am-u-md-2 am-text-right">
                                        链接网址
                                    </div>
                                    <div class="am-u-sm-8 am-u-md-5">
                                        <input type="text" class="am-input-sm" name="url">
                                    </div>
                                    <div class="am-hide-sm-only am-u-md-6"></div>
                                </div>
                                <div class="am-g am-margin-top">
                                    <div class="am-u-sm-4 am-u-md-2 am-text-right">
                                        排序
                                    </div>
                                    <div class="am-u-sm-8 am-u-md-5">
                                        <input type="text" class="am-input-sm" name="sort">
                                    </div>
                                    <div class="am-hide-sm-only am-u-md-6"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="am-margin">
                        <button type="submit" class="am-btn am-btn-primary am-radius">提交保存</button>
                    </div>
                </form>
            </div>
        </div>


    </div>
</block>
<block name="js">
    <script src="/vendor/admin/html5-fileupload/jquery.html5-fileupload.js"></script>
    <script src="/vendor/admin/js/upload.js"></script>
</block>

